<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link href="./css/ltcss.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TerraceInfo</title>
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<script src="js/jquery/jquery-1.3.2.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript" src="js/DatePicker4.72/WdatePicker.js"></script>

    <script type="text/javascript">
function txcheck(){
	return formvalidator("all");
}
var flag=0;
function formvalidator(obj)
{
	var controlId = "all";
	 if (typeof(obj) != "string" )
	 {
		 controlId = obj.id;
	 }
	 if(controlId=="all" || controlId=="model.code")
		{
			if(Utils.trim(document.getElementById("model.code").value)=="")
			{
				$("#CompareValidator1").text("不能为空！");
				document.getElementById("CompareValidator1").style.visibility="visible";
				return false;
			}
			else
			{
				$.get("terraceInfo_chkCode.do?model.code="+Utils.trim(document.getElementById("model.code").value),function(data){
					if(data=="1"){
						$("#CompareValidator1").text("代码Code重复，请检查！");
						document.getElementById("CompareValidator1").style.visibility="visible";
						flag=1;
						return false;
					}else{
						document.getElementById("CompareValidator1").style.visibility="hidden";
						flag=0;
					}
				});
				
			}
		}
	if(controlId=="all" || controlId=="model.operatorsName")
	{
		if(Utils.trim(document.getElementById("model.operatorsName").value)=="")
		{
			document.getElementById("CompareValidator2").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator2").style.visibility="hidden";
		}
	}
	if(controlId=="all" || controlId=="model.url")
	{
		if(Utils.trim(document.getElementById("model.url").value)=="")
		{
			document.getElementById("CompareValidator3").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator3").style.visibility="hidden";
		}
	}
	if(controlId=="all" || controlId=="model.loginName")
	{
		if(Utils.trim(document.getElementById("model.loginName").value)=="")
		{
			document.getElementById("CompareValidator4").style.visibility="visible";
			return false;
		}
		else
		{
			document.getElementById("CompareValidator4").style.visibility="hidden";
		}
	}
	if(flag>0){
		return false;
	}
	return true;
}

function chkAll(vl,name)
{
	var v = document.getElementsByName(name);
	for(var i=0;i<v.length;i++)
	{
		v[i].checked=vl;
	}
	
}

</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="terraceInfo_save.do?msg=<s:property value="msg" />" onsubmit="return txcheck();">
 <input type="hidden" name="model.id" id="model.id" value="<s:property value="model.id"/>" />
 <input type="hidden" name="txt_keyword" id="txt_keyword" value="<s:property value="txt_keyword"/>" />
 <h1>
        <span class="action-span"><a href="terraceInfo_list.do">平台列表</a></span> <span
            class="action-span1"><a href="">
                首页</a> </span><span id="search_id" class="action-span1">- 平台管理 </span>
        <div style="clear: both">
        </div>
    </h1>
 <div style="margin-bottom: 5px;" class="list-div">
        <table width="100%" cellspacing="1" cellpadding="3">
            <tbody>
                <tr>
                    <th colspan="2">
                        基本信息
                    </th>
                </tr>
                <tr> 
				    <td  class="label"><div align="right">代码：</div></td> 
				    <td>
				    <s:if test='msg.equals("update")'>
				    <s:property value="model.code" /><input type="hidden" name="model.code" id="model.code" value="<s:property value="model.code" />" />
				    </s:if>
				    <s:else>
				    <input id="model.code" name="model.code" type="text" size="60" 
          					value="<s:property value="model.code" />"  onblur="formvalidator(this)"/>
						<span
                           class="require-field">*</span>&nbsp;
                        <span id="CompareValidator1" style="color:Red;visibility:hidden;">不能为空</span>
				    </s:else>
					    <br />
                    </td>
				  </tr>
                <tr> 
				    <td  class="label"><div align="right">平台名称：</div></td> 
				    <td>
					    <input id="model.operatorsName" name="model.operatorsName" type="text" size="60" 
          					value="<s:property value="model.operatorsName" />"  onblur="formvalidator(this)"/>
						<span
                           class="require-field">*</span>&nbsp;
                        <span id="CompareValidator2" style="color:Red;visibility:hidden;">不能为空</span><br />
                    </td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">url：</div></td> 
				    <td >
					   <input id="model.url" name="model.url" type="text" size="60"  
					   		value="<s:property value="model.url" />"  onblur="formvalidator(this)" />
					   <span class="require-field">*</span>&nbsp;
                        <span id="CompareValidator3" style="color:Red;visibility:hidden;">不能为空</span><br />
                    </td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">账号：</div></td> 
				    <td >
					   <input id="model.loginName" name="model.loginName" type="text" size="60"
					   	  value="<s:property value="model.loginName" />"  onblur="formvalidator(this)"/>
					   <span class="require-field">*</span>&nbsp;
                        <span id="CompareValidator4" style="color:Red;visibility:hidden;">不能为空</span><br />
                    </td>
				  </tr>
				   <tr> 
				    <td class="label"><div align="right">密码：</div></td> 
				    <td >
					   <input id="model.password" name="model.password" type="text" size="60"  
					   value="<s:property value="model.password" />" onblur="formvalidator(this)" />
                    </td>
				  </tr>
				   <tr> 
				    <td class="label"><div align="right">合同有效期：</div></td> 
				    <td >
					    <input type="text" size="20" name="model.contractPeriod" id="model.contractPeriod" 
					    onFocus="WdatePicker({isShowWeek:true,dateFmt:'yyyy-MM-dd',skin:'whyGreen'})" 
					    onblur="formvalidator(this)" value="<s:property value="model.contractPeriod" />"/>
                    </td>
				  </tr>
				  <tr> 
				    <td class="label"><div align="right">描述：</div></td> 
				    <td >
					   <textarea name="model.remark" id="model.remark" rows="6" cols="60"><s:property value="model.remark" /></textarea>
                    </td>
				  </tr>			 
				  <tr>
                    <td colspan="2" align="center">
                     <s:if test="isUpdate.equals('true')">
					    <input type="submit" value=" 确定 " class="button" />
                        &nbsp;&nbsp;&nbsp;
                        <input type="reset" value=" 重置 " class="button" />
                     </s:if>
                    </td>
                </tr>
	 	</tbody>
	 </table>
 </div>
</form>
 <!--Bottom开始-->
    
<div id="footer">
<br />
<s:property value="bottom"/></div>
    <!--Bottom结束-->
  
</body>
</html>